import axios from 'axios'
// import store from '@/store'
// import storage from 'store'
// import { ACCESS_TOKEN } from '@/store/mutation-types'

// 创建 axios 实例
// oss
const oss = axios.create({
    baseURL: "http://osssignin.comeonfans.com",
    // timeout: 3 * 1000,
});
oss.interceptors.request.use((config) => {
    // config.headers["Access-Token"] = "oohmEwvbcIxQQCDASY7BSdsiUrrg";
    config.data = JSON.stringify(config.data);

    config.headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept': 'application/json;application/json'
    }

    return config;
}, errorHandler);

// response interceptor
oss.interceptors.response.use((response) => {
    return response.data;
}, errorHandler);

export default oss